#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int sum = 0;
	long long x;
	for (int i = 0; i < n; i++) {
		cin >> x;
		for (int j = 1; j <= x; j++) {
			if (x % j == 0) {
				sum += j;
			}
		}
	}
	cout << sum << endl;
	return 0;
}